```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java线程池深入解析</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            line-height: 1.6;
            color: #333;
        }
        .hero-bg {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .code-block {
            background-color: #2d2d2d;
            border-radius: 8px;
            padding: 1.5rem;
            position: relative;
        }
        .code-block pre {
            margin: 0;
            color: #f8f8f2;
            font-family: 'Courier New', Courier, monospace;
            overflow-x: auto;
        }
        .code-block .copy-btn {
            position: absolute;
            right: 10px;
            top: 10px;
            background: rgba(255,255,255,0.1);
            color: white;
            border: none;
            border-radius: 4px;
            padding: 2px 8px;
            cursor: pointer;
            transition: all 0.3s;
        }
        .code-block .copy-btn:hover {
            background: rgba(255,255,255,0.2);
        }
        .card {
            transition: transform 0.3s, box-shadow 0.3s;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        }
        .param-table {
            width: 100%;
            border-collapse: collapse;
        }
        .param-table th, .param-table td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #e2e8f0;
        }
        .param-table th {
            background-color: #f7fafc;
            font-weight: 600;
        }
        .param-table tr:hover td {
            background-color: #f8fafc;
        }
        .mermaid-container {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-bg text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl flex flex-col items-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6 text-center font-serif">Java线程池深度解析</h1>
            <p class="text-xl md:text-2xl text-center max-w-3xl mb-8 font-light">高性能并发编程的核心利器</p>
            <div class="flex space-x-4">
                <div class="bg-white bg-opacity-20 px-6 py-3 rounded-full flex items-center">
                    <i class="fas fa-code mr-2"></i>
                    <span>并发编程</span>
                </div>
                <div class="bg-white bg-opacity-20 px-6 py-3 rounded-full flex items-center">
                    <i class="fas fa-microchip mr-2"></i>
                    <span>多线程优化</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 md:px-0 py-12">
        <!-- Introduction -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 font-serif">线程池的重要性</h2>
                <p class="text-lg text-gray-700 mb-6">在现代Java应用中，线程池是管理多线程任务执行的核心组件。它不仅可以提高资源利用率，还能有效控制并发度，避免因线程创建过多导致的系统性能下降。</p>
                <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                    <div class="card bg-gradient-to-br from-blue-50 to-indigo-50 p-6 rounded-lg">
                        <div class="text-blue-600 text-3xl mb-4">
                            <i class="fas fa-bolt"></i>
                        </div>
                        <h3 class="font-bold text-lg mb-2">高性能</h3>
                        <p class="text-gray-600">复用已有线程减少创建销毁开销</p>
                    </div>
                    <div class="card bg-gradient-to-br from-purple-50 to-pink-50 p-6 rounded-lg">
                        <div class="text-purple-600 text-3xl mb-4">
                            <i class="fas fa-sliders-h"></i>
                        </div>
                        <h3 class="font-bold text-lg mb-2">可调控</h3>
                        <p class="text-gray-600">灵活配置线程数量和执行策略</p>
                    </div>
                    <div class="card bg-gradient-to-br from-green-50 to-teal-50 p-6 rounded-lg">
                        <div class="text-green-600 text-3xl mb-4">
                            <i class="fas fa-shield-alt"></i>
                        </div>
                        <h3 class="font-bold text-lg mb-2">稳定性</h3>
                        <p class="text-gray-600">防止资源耗尽导致的系统崩溃</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Key Interfaces -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 font-serif">线程池实现的关键接口</h2>
                
                <!-- Executor Interface -->
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-blue-600 flex items-center">
                        <i class="fas fa-project-diagram mr-3"></i>
                        Executor接口
                    </h3>
                    <p class="text-gray-700 mb-6">Executor接口是Java中最基本的任务执行框架。它只定义了一个方法，主要作用是将任务提交与任务的实际执行分离开来。它允许不同的执行策略，如立即执行、使用线程池执行、顺序执行等。</p>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                        <pre><code>public interface Executor {
    void execute(Runnable command);
}</code></pre>
                    </div>
                    
                    <div class="bg-blue-50 p-4 rounded-lg mb-6">
                        <h4 class="font-semibold text-blue-800 mb-2">示例代码</h4>
                        <div class="code-block">
                            <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                            <pre><code>Executor executor = new Executor() {
    @Override
    public void execute(Runnable command) {
        new Thread(command).start();
    }
};
executor.execute(() -> System.out.println("Task executed!"));</code></pre>
                        </div>
                    </div>
                </div>
                
                <!-- ExecutorService Interface -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4 text-purple-600 flex items-center">
                        <i class="fas fa-cogs mr-3"></i>
                        ExecutorService接口
                    </h3>
                    <p class="text-gray-700 mb-6">ExecutorService接口继承自Executor，并增加了管理和控制任务执行的能力。它提供了生命周期管理方法，如启动、关闭和等待终止，以及更高级的功能，如任务提交、批量任务执行、任务的取消和监控等。</p>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                        <pre><code>public interface ExecutorService extends Executor {
    void shutdown();
    List&lt;Runnable&gt; shutdownNow();
    boolean isShutdown();
    boolean isTerminated();
    boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException;
    &lt;T&gt; Future&lt;T&gt; submit(Callable&lt;T&gt; task);
    &lt;T&gt; Future&lt;T&gt; submit(Runnable task, T result);
    Future&lt;?&gt; submit(Runnable task);
    &lt;T&gt; List&lt;Future&lt;T&gt;&gt; invokeAll(Collection&lt;? extends Callable&lt;T&gt;&gt; tasks) throws InterruptedException;
    &lt;T&gt; List&lt;Future&lt;T&gt;&gt; invokeAll(Collection&lt;? extends Callable&lt;T&gt;&gt; tasks, long timeout, TimeUnit unit) throws InterruptedException;
    &lt;T&gt; T invokeAny(Collection&lt;? extends Callable&lt;T&gt;&gt; tasks) throws InterruptedException, ExecutionException;
    &lt;T&gt; T invokeAny(Collection&lt;? extends Callable&lt;T&gt;&gt; tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException;
}</code></pre>
                    </div>
                    
                    <div class="bg-purple-50 p-4 rounded-lg">
                        <h4 class="font-semibold text-purple-800 mb-2">示例代码</h4>
                        <div class="code-block">
                            <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                            <pre><code>ExecutorService executorService = Executors.newFixedThreadPool(10);
executorService.submit(() -> System.out.println("Task executed!"));
executorService.shutdown();</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Thread Pool Implementations -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 font-serif">线程池的实现类</h2>
                <p class="text-gray-700 mb-8">Java提供了几种常见的线程池实现类，位于java.util.concurrent包中。这些类通常通过静态工厂方法Executors来创建实例。</p>
                
                <!-- ThreadPoolExecutor -->
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-green-600 flex items-center">
                        <i class="fas fa-layer-group mr-3"></i>
                        ThreadPoolExecutor
                    </h3>
                    <p class="text-gray-700 mb-6">ThreadPoolExecutor是最灵活和强大的线程池实现类。它允许我们通过构造函数参数自定义线程池的行为。</p>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                        <pre><code>public class ThreadPoolExecutor extends AbstractExecutorService {
    public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, 
                            long keepAliveTime, TimeUnit unit, 
                            BlockingQueue&lt;Runnable&gt; workQueue) {
        // initialization code
    }
    // additional methods and overrides
}</code></pre>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="font-semibold text-lg mb-4 text-gray-700">参数说明</h4>
                        <div class="overflow-x-auto">
                            <table class="param-table">
                                <thead>
                                    <tr>
                                        <th>参数</th>
                                        <th>说明</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td class="font-mono">corePoolSize</td>
                                        <td>核心线程池大小</td>
                                    </tr>
                                    <tr>
                                        <td class="font-mono">maximumPoolSize</td>
                                        <td>最大线程池大小</td>
                                    </tr>
                                    <tr>
                                        <td class="font-mono">keepAliveTime</td>
                                        <td>非核心线程空闲时间</td>
                                    </tr>
                                    <tr>
                                        <td class="font-mono">unit</td>
                                        <td>时间单位</td>
                                    </tr>
                                    <tr>
                                        <td class="font-mono">workQueue</td>
                                        <td>任务队列</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    
                    <div class="bg-green-50 p-4 rounded-lg">
                        <h4 class="font-semibold text-green-800 mb-2">示例代码</h4>
                        <div class="code-block">
                            <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                            <pre><code>ThreadPoolExecutor executor = new ThreadPoolExecutor(
    2, 4, 60, TimeUnit.SECONDS, new LinkedBlockingQueue&lt;Runnable&gt;()
);
executor.execute(() -> System.out.println("Task executed!"));
executor.shutdown();</code></pre>
                        </div>
                    </div>
                </div>
                
                <!-- ScheduledThreadPoolExecutor -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4 text-orange-600 flex items-center">
                        <i class="fas fa-clock mr-3"></i>
                        ScheduledThreadPoolExecutor
                    </h3>
                    <p class="text-gray-700 mb-6">ScheduledThreadPoolExecutor是一个可以调度任务在给定延迟后运行或周期性执行的线程池实现类。</p>
                    
                    <div class="bg-orange-50 p-4 rounded-lg">
                        <h4 class="font-semibold text-orange-800 mb-2">示例代码</h4>
                        <div class="code-block">
                            <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                            <pre><code>ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(5);
scheduler.schedule(() -> System.out.println("Task executed after delay!"), 5, TimeUnit.SECONDS);
scheduler.shutdown();</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Thread Pool Types -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 font-serif">线程池的类型</h2>
                <p class="text-gray-700 mb-8">通过Executors工厂类可以创建多种常见类型的线程池：</p>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <!-- FixedThreadPool -->
                    <div class="card border border-gray-200 rounded-lg p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-blue-100 p-3 rounded-full mr-4">
                                <i class="fas fa-anchor text-blue-600"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">FixedThreadPool</h3>
                        </div>
                        <p class="text-gray-600 mb-4">固定大小的线程池，适用于负载稳定的场景。</p>
                        <div class="code-block">
                            <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                            <pre><code>ExecutorService fixedThreadPool = 
    Executors.newFixedThreadPool(10);</code></pre>
                        </div>
                    </div>
                    
                    <!-- CachedThreadPool -->
                    <div class="card border border-gray-200 rounded-lg p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-green-100 p-3 rounded-full mr-4">
                                <i class="fas fa-expand text-green-600"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">CachedThreadPool</h3>
                        </div>
                        <p class="text-gray-600 mb-4">大小不固定的线程池，适用于大量短期任务。</p>
                        <div class="code-block">
                            <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                            <pre><code>ExecutorService cachedThreadPool = 
    Executors.newCachedThreadPool();</code></pre>
                        </div>
                    </div>
                    
                    <!-- SingleThreadExecutor -->
                    <div class="card border border-gray-200 rounded-lg p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-purple-100 p-3 rounded-full mr-4">
                                <i class="fas fa-stream text-purple-600"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">SingleThreadExecutor</h3>
                        </div>
                        <p class="text-gray-600 mb-4">单线程执行器，适用于需要保证任务顺序执行的场景。</p>
                        <div class="code-block">
                            <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                            <pre><code>ExecutorService singleThreadExecutor = 
    Executors.newSingleThreadExecutor();</code></pre>
                        </div>
                    </div>
                    
                    <!-- ScheduledThreadPool -->
                    <div class="card border border-gray-200 rounded-lg p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-orange-100 p-3 rounded-full mr-4">
                                <i class="fas fa-clock text-orange-600"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">ScheduledThreadPool</h3>
                        </div>
                        <p class="text-gray-600 mb-4">支持定时和周期性任务执行。</p>
                        <div class="code-block">
                            <button class="copy-btn" onclick="copyCode(this)"><i class="fas fa-copy"></i></button>
                            <pre><code>ScheduledExecutorService scheduledThreadPool = 
    Executors.newScheduledThreadPool(5);</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Visualization -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 font-serif">线程池关系图</h2>
                <div class="mermaid-container">
                    <div class="mermaid">
                        classDiagram
                            class Executor {
                                +execute(Runnable command)
                            }
                            
                            class ExecutorService {
                                +shutdown()
                                +shutdownNow() List~Runnable~
                                +isShutdown() boolean
                                +isTerminated() boolean
                                +awaitTermination(long, TimeUnit) boolean
                                +submit(Callable~T~) Future~T~
                                +submit(Runnable, T) Future~T~
                                +submit(Runnable) Future~?~
                                +invokeAll(Collection~Callable~T~~) List~Future~T~~
                                +invokeAny(Collection~Callable~T~~) T
                            }
                            
                            class AbstractExecutorService {
                                +submit(Callable~T~) Future~T~
                                +submit(Runnable, T) Future~T~
                                +submit(Runnable) Future~?~
                                +invokeAll(Collection~Callable~T~~) List~Future~T~~
                                +invokeAny(Collection~Callable~T~~) T
                            }
                            
                            class ThreadPoolExecutor {
                                +ThreadPoolExecutor(int, int, long, TimeUnit, BlockingQueue~Runnable~)
                            }
                            
                            class ScheduledExecutorService {
                                +schedule(Runnable, long, TimeUnit) ScheduledFuture~?~
                                +schedule(Callable~T~, long, TimeUnit) ScheduledFuture~T~
                                +scheduleAtFixedRate(Runnable, long, long, TimeUnit) ScheduledFuture~?~
                                +scheduleWithFixedDelay(Runnable, long, long, TimeUnit) ScheduledFuture~?~
                            }
                            
                            class ScheduledThreadPoolExecutor {
                                +ScheduledThreadPoolExecutor(int)
                            }
                            
                            class Executors {
                                +newFixedThreadPool(int) ExecutorService
                                +newCachedThreadPool() ExecutorService
                                +newSingleThreadExecutor() ExecutorService
                                +newScheduledThreadPool(int) ScheduledExecutorService
                            }
                            
                            Executor <|-- ExecutorService
                            ExecutorService <|-- AbstractExecutorService
                            AbstractExecutorService <|-- ThreadPoolExecutor
                            ExecutorService <|-- ScheduledExecutorService
                            ScheduledExecutorService <|-- ScheduledThreadPoolExecutor
                            ThreadPoolExecutor <|-- ScheduledThreadPoolExecutor
                            Executors --> ThreadPoolExecutor
                            Executors --> ScheduledThreadPoolExecutor
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12">
        <div class="container mx-auto max-w-5xl px-4 md:px-0">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">专业的Java技术分享平台</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition-colors duration-300">
                        <i class="fas fa-globe mr-2"></i> http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true
            }
        });
        
        // Copy code block function
        function copyCode(button) {
            const codeBlock = button.parentElement;
            const code = codeBlock.querySelector('pre').innerText;
            navigator.clipboard.writeText(code).then(() => {
                const originalText = button.innerHTML;
                button.innerHTML = '<i class="fas fa-check"></i>';
                setTimeout(() => {
                    button.innerHTML = originalText;
                }, 2000);
            });
        }
        
        // Card hover animation
        document.querySelectorAll('.card').forEach(card => {
            card.addEventListener('mouseenter', () => {
                card.style.transform = 'translateY(-5px)';
                card.style.boxShadow = '0 10px 25px rgba(0,0,0,0.1)';
            });
            card.addEventListener('mouseleave', () => {
                card.style.transform = '';
                card.style.boxShadow = '';
            });
        });
    </script>
</body>
</html>
```